import React from 'react';
import { RuleManageAPI } from '../common/type';
import { getLevelFirst, getLevelZero, getUserID } from '@/utils';

const ManageTabSwitch = (curRes: Record<string, any>) => {
  if (curRes?.['/purchaseStyleRuleController/createCompanyID']) {
    // 公司权限
    return {
      params: 'createCompanyID',
      createCompanyID: getLevelZero(),
    };
  } else if (curRes?.['/purchaseStyleRuleController/createDepartmentID']) {
    return {
      createDepartmentID: getLevelFirst(),
      params: 'createDepartmentID',
    };
  } else if (curRes?.['/purchaseStyleRuleController/createDepartmentID']) {
    return {
      createrID: getUserID(),
      params: 'createrID',
    };
  }
};
export { ManageTabSwitch };
